const KoaRouter = require("@koa/router");
const { refresh, verifyAuth } = require("../middleware/authority.middleware");
const { test } = require("../controller/authority.controller");

// 1. 创建路由对象
const authorityRouter = new KoaRouter({ prefix: "/authority" });

// 2. 定义路由中的映射
// 长Token刷新双token
authorityRouter.get("/refresh", refresh);

// 2.2测试接口，验证jwt是否正常
authorityRouter.get("/test", verifyAuth, test);

module.exports = authorityRouter;
